HIVE-29634: Fix semijoin RHS column registration for multiple columns from same alias#6516
HIVE-29634: Fix semijoin RHS column registration for multiple columns from same alias#6516tanishq-chugh wants to merge 3 commits into
Conversation
| if (rightAliases.size() > rhssize) { // the new table is rhs table | ||
| rhsAlias = rightAliases.get(rightAliases.size() - 1); | ||
| } else if (condn.getChild(0).getType() == HiveParser.TOK_TABLE_OR_COL) { | ||
| String alias = unescapeIdentifier(condn.getChild(0).getChild(0).getText().toLowerCase()); |
There was a problem hiding this comment.
I think we need a comment here to explain what this else-if branch is doing, and why we couldn't simply rely on the recursive call to parseJoinCondPopulateAlias.
Also, do you think we need to check for nulls anywhere in condn.getChild(0).getChild(0).getText()? I am not sure if anything can be null here, could you please check?
There was a problem hiding this comment.
Hi @soumyakanti3578, Thanks for checking this!
Post your comment, i was going through the fix again and have found a better way to fix the issue where we are using the existing recursive call itself, this way the hardcoded code to fetch AST child written previously is avoided. Please check it out and let me know your thoughts. Thanks!
There was a problem hiding this comment.
The new approach is definitely better, thanks!
|



What changes were proposed in this pull request?
Fix semijoin join-condition parsing so every RHS column from the same alias is registered
Why are the changes needed?
To fix the query with LEFT OUTER JOIN and CONCAT running into SemanticException
Does this PR introduce any user-facing change?
Yes, fixes a query running into SemanticException at runtime.
How was this patch tested?
Manual Testing + added a Qtest